
// MIT License
// 
// Copyright (c) 2009-2017 Luca Piccioni
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// 
// This file is automatically generated

#pragma warning disable 649, 1572, 1573

// ReSharper disable RedundantUsingDirective
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;

using Khronos;

// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable JoinDeclarationAndInitializer

namespace OpenGL
{
	public partial class Gl
	{
		/// <summary>
		/// [GL] glUseShaderProgramEXT: Binding for glUseShaderProgramEXT.
		/// </summary>
		/// <param name="type">
		/// A <see cref="T:int"/>.
		/// </param>
		/// <param name="program">
		/// A <see cref="T:uint"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects")]
		public static void UseShaderProgramEXT(int type, uint program)
		{
			Debug.Assert(Delegates.pglUseShaderProgramEXT != null, "pglUseShaderProgramEXT not implemented");
			Delegates.pglUseShaderProgramEXT(type, program);
			LogCommand("glUseShaderProgramEXT", null, type, program			);
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glActiveProgramEXT: Binding for glActiveProgramEXT.
		/// </summary>
		/// <param name="program">
		/// A <see cref="T:uint"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects")]
		public static void ActiveProgramEXT(uint program)
		{
			Debug.Assert(Delegates.pglActiveProgramEXT != null, "pglActiveProgramEXT not implemented");
			Delegates.pglActiveProgramEXT(program);
			LogCommand("glActiveProgramEXT", null, program			);
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glCreateShaderProgramEXT: Binding for glCreateShaderProgramEXT.
		/// </summary>
		/// <param name="type">
		/// A <see cref="T:ShaderType"/>.
		/// </param>
		/// <param name="string">
		/// A <see cref="T:string"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects")]
		public static uint CreateShaderProgramEXT(ShaderType type, string @string)
		{
			uint retValue;

			Debug.Assert(Delegates.pglCreateShaderProgramEXT != null, "pglCreateShaderProgramEXT not implemented");
			retValue = Delegates.pglCreateShaderProgramEXT((int)type, @string);
			LogCommand("glCreateShaderProgramEXT", retValue, type, @string			);
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [GL] glActiveShaderProgramEXT: Binding for glActiveShaderProgramEXT.
		/// </summary>
		/// <param name="pipeline">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="program">
		/// A <see cref="T:uint"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static void ActiveShaderProgramEXT(uint pipeline, uint program)
		{
			Debug.Assert(Delegates.pglActiveShaderProgramEXT != null, "pglActiveShaderProgramEXT not implemented");
			Delegates.pglActiveShaderProgramEXT(pipeline, program);
			LogCommand("glActiveShaderProgramEXT", null, pipeline, program			);
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glBindProgramPipelineEXT: Binding for glBindProgramPipelineEXT.
		/// </summary>
		/// <param name="pipeline">
		/// A <see cref="T:uint"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static void BindProgramPipelineEXT(uint pipeline)
		{
			Debug.Assert(Delegates.pglBindProgramPipelineEXT != null, "pglBindProgramPipelineEXT not implemented");
			Delegates.pglBindProgramPipelineEXT(pipeline);
			LogCommand("glBindProgramPipelineEXT", null, pipeline			);
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glCreateShaderProgramvEXT: Binding for glCreateShaderProgramvEXT.
		/// </summary>
		/// <param name="type">
		/// A <see cref="T:ShaderType"/>.
		/// </param>
		/// <param name="count">
		/// A <see cref="T:int"/>.
		/// </param>
		/// <param name="strings">
		/// A <see cref="T:string[]"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static uint CreateShaderProgramEXT(ShaderType type, int count, string[] strings)
		{
			uint retValue;

			Debug.Assert(Delegates.pglCreateShaderProgramvEXT != null, "pglCreateShaderProgramvEXT not implemented");
			retValue = Delegates.pglCreateShaderProgramvEXT((int)type, count, strings);
			LogCommand("glCreateShaderProgramvEXT", retValue, type, count, strings			);
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [GL] glCreateShaderProgramvEXT: Binding for glCreateShaderProgramvEXT.
		/// </summary>
		/// <param name="type">
		/// A <see cref="T:ShaderType"/>.
		/// </param>
		/// <param name="strings">
		/// A <see cref="T:string[]"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static uint CreateShaderProgramEXT(ShaderType type, string[] strings)
		{
			uint retValue;

			Debug.Assert(Delegates.pglCreateShaderProgramvEXT != null, "pglCreateShaderProgramvEXT not implemented");
			retValue = Delegates.pglCreateShaderProgramvEXT((int)type, strings.Length, strings);
			LogCommand("glCreateShaderProgramvEXT", retValue, type, strings.Length, strings			);
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [GL] glDeleteProgramPipelinesEXT: Binding for glDeleteProgramPipelinesEXT.
		/// </summary>
		/// <param name="pipelines">
		/// A <see cref="T:uint[]"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static void DeleteProgramPipelinesEXT(params uint[] pipelines)
		{
			unsafe {
				fixed (uint* p_pipelines = pipelines)
				{
					Debug.Assert(Delegates.pglDeleteProgramPipelinesEXT != null, "pglDeleteProgramPipelinesEXT not implemented");
					Delegates.pglDeleteProgramPipelinesEXT(pipelines.Length, p_pipelines);
					LogCommand("glDeleteProgramPipelinesEXT", null, pipelines.Length, pipelines					);
				}
			}
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glGenProgramPipelinesEXT: Binding for glGenProgramPipelinesEXT.
		/// </summary>
		/// <param name="pipelines">
		/// A <see cref="T:uint[]"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static void GenProgramPipelinesEXT(uint[] pipelines)
		{
			unsafe {
				fixed (uint* p_pipelines = pipelines)
				{
					Debug.Assert(Delegates.pglGenProgramPipelinesEXT != null, "pglGenProgramPipelinesEXT not implemented");
					Delegates.pglGenProgramPipelinesEXT(pipelines.Length, p_pipelines);
					LogCommand("glGenProgramPipelinesEXT", null, pipelines.Length, pipelines					);
				}
			}
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glGenProgramPipelinesEXT: Binding for glGenProgramPipelinesEXT.
		/// </summary>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static uint GenProgramPipelineEXT()
		{
			uint retValue;
			unsafe {
				Delegates.pglGenProgramPipelinesEXT(1, &retValue);
				LogCommand("glGenProgramPipelinesEXT", null, 1, "{ " + retValue + " }"				);
			}
			DebugCheckErrors(null);
			return (retValue);
		}

		/// <summary>
		/// [GL] glGetProgramPipelineInfoLogEXT: Binding for glGetProgramPipelineInfoLogEXT.
		/// </summary>
		/// <param name="pipeline">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="bufSize">
		/// A <see cref="T:int"/>.
		/// </param>
		/// <param name="length">
		/// A <see cref="T:int"/>.
		/// </param>
		/// <param name="infoLog">
		/// A <see cref="T:StringBuilder"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static void GetProgramPipelineInfoLogEXT(uint pipeline, int bufSize, out int length, StringBuilder infoLog)
		{
			unsafe {
				fixed (int* p_length = &length)
				{
					Debug.Assert(Delegates.pglGetProgramPipelineInfoLogEXT != null, "pglGetProgramPipelineInfoLogEXT not implemented");
					Delegates.pglGetProgramPipelineInfoLogEXT(pipeline, bufSize, p_length, infoLog);
					LogCommand("glGetProgramPipelineInfoLogEXT", null, pipeline, bufSize, length, infoLog					);
				}
			}
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glGetProgramPipelineivEXT: Binding for glGetProgramPipelineivEXT.
		/// </summary>
		/// <param name="pipeline">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="pname">
		/// A <see cref="T:PipelineParameterName"/>.
		/// </param>
		/// <param name="params">
		/// A <see cref="T:int[]"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static void GetProgramPipelineEXT(uint pipeline, PipelineParameterName pname, [Out] int[] @params)
		{
			unsafe {
				fixed (int* p_params = @params)
				{
					Debug.Assert(Delegates.pglGetProgramPipelineivEXT != null, "pglGetProgramPipelineivEXT not implemented");
					Delegates.pglGetProgramPipelineivEXT(pipeline, (int)pname, p_params);
					LogCommand("glGetProgramPipelineivEXT", null, pipeline, pname, @params					);
				}
			}
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glGetProgramPipelineivEXT: Binding for glGetProgramPipelineivEXT.
		/// </summary>
		/// <param name="pipeline">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="pname">
		/// A <see cref="T:PipelineParameterName"/>.
		/// </param>
		/// <param name="params">
		/// A <see cref="T:int"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static void GetProgramPipelineEXT(uint pipeline, PipelineParameterName pname, out int @params)
		{
			unsafe {
				fixed (int* p_params = &@params)
				{
					Debug.Assert(Delegates.pglGetProgramPipelineivEXT != null, "pglGetProgramPipelineivEXT not implemented");
					Delegates.pglGetProgramPipelineivEXT(pipeline, (int)pname, p_params);
					LogCommand("glGetProgramPipelineivEXT", null, pipeline, pname, @params					);
				}
			}
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glIsProgramPipelineEXT: Binding for glIsProgramPipelineEXT.
		/// </summary>
		/// <param name="pipeline">
		/// A <see cref="T:uint"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static bool IsProgramPipelineEXT(uint pipeline)
		{
			bool retValue;

			Debug.Assert(Delegates.pglIsProgramPipelineEXT != null, "pglIsProgramPipelineEXT not implemented");
			retValue = Delegates.pglIsProgramPipelineEXT(pipeline);
			LogCommand("glIsProgramPipelineEXT", retValue, pipeline			);
			DebugCheckErrors(retValue);

			return (retValue);
		}

		/// <summary>
		/// [GL] glUseProgramStagesEXT: Binding for glUseProgramStagesEXT.
		/// </summary>
		/// <param name="pipeline">
		/// A <see cref="T:uint"/>.
		/// </param>
		/// <param name="stages">
		/// A <see cref="T:UseProgramStageMask"/>.
		/// </param>
		/// <param name="program">
		/// A <see cref="T:uint"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static void UseProgramStageEXT(uint pipeline, UseProgramStageMask stages, uint program)
		{
			Debug.Assert(Delegates.pglUseProgramStagesEXT != null, "pglUseProgramStagesEXT not implemented");
			Delegates.pglUseProgramStagesEXT(pipeline, (uint)stages, program);
			LogCommand("glUseProgramStagesEXT", null, pipeline, stages, program			);
			DebugCheckErrors(null);
		}

		/// <summary>
		/// [GL] glValidateProgramPipelineEXT: Binding for glValidateProgramPipelineEXT.
		/// </summary>
		/// <param name="pipeline">
		/// A <see cref="T:uint"/>.
		/// </param>
		[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
		public static void ValidateProgramPipelineEXT(uint pipeline)
		{
			Debug.Assert(Delegates.pglValidateProgramPipelineEXT != null, "pglValidateProgramPipelineEXT not implemented");
			Delegates.pglValidateProgramPipelineEXT(pipeline);
			LogCommand("glValidateProgramPipelineEXT", null, pipeline			);
			DebugCheckErrors(null);
		}

		internal static unsafe partial class Delegates
		{
			[RequiredByFeature("GL_EXT_separate_shader_objects")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glUseShaderProgramEXT(int type, uint program);

			[RequiredByFeature("GL_EXT_separate_shader_objects")]
			[ThreadStatic]
			internal static glUseShaderProgramEXT pglUseShaderProgramEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glActiveProgramEXT(uint program);

			[RequiredByFeature("GL_EXT_separate_shader_objects")]
			[ThreadStatic]
			internal static glActiveProgramEXT pglActiveProgramEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate uint glCreateShaderProgramEXT(int type, string @string);

			[RequiredByFeature("GL_EXT_separate_shader_objects")]
			[ThreadStatic]
			internal static glCreateShaderProgramEXT pglCreateShaderProgramEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glActiveShaderProgramEXT(uint pipeline, uint program);

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[ThreadStatic]
			internal static glActiveShaderProgramEXT pglActiveShaderProgramEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glBindProgramPipelineEXT(uint pipeline);

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[ThreadStatic]
			internal static glBindProgramPipelineEXT pglBindProgramPipelineEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate uint glCreateShaderProgramvEXT(int type, int count, string[] strings);

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[ThreadStatic]
			internal static glCreateShaderProgramvEXT pglCreateShaderProgramvEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glDeleteProgramPipelinesEXT(int n, uint* pipelines);

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[ThreadStatic]
			internal static glDeleteProgramPipelinesEXT pglDeleteProgramPipelinesEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glGenProgramPipelinesEXT(int n, uint* pipelines);

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[ThreadStatic]
			internal static glGenProgramPipelinesEXT pglGenProgramPipelinesEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glGetProgramPipelineInfoLogEXT(uint pipeline, int bufSize, int* length, StringBuilder infoLog);

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[ThreadStatic]
			internal static glGetProgramPipelineInfoLogEXT pglGetProgramPipelineInfoLogEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glGetProgramPipelineivEXT(uint pipeline, int pname, int* @params);

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[ThreadStatic]
			internal static glGetProgramPipelineivEXT pglGetProgramPipelineivEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[SuppressUnmanagedCodeSecurity]
			[return: MarshalAs(UnmanagedType.I1)]
			internal delegate bool glIsProgramPipelineEXT(uint pipeline);

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[ThreadStatic]
			internal static glIsProgramPipelineEXT pglIsProgramPipelineEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glUseProgramStagesEXT(uint pipeline, uint stages, uint program);

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[ThreadStatic]
			internal static glUseProgramStagesEXT pglUseProgramStagesEXT;

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[SuppressUnmanagedCodeSecurity]
			internal delegate void glValidateProgramPipelineEXT(uint pipeline);

			[RequiredByFeature("GL_EXT_separate_shader_objects", Api = "gles2")]
			[ThreadStatic]
			internal static glValidateProgramPipelineEXT pglValidateProgramPipelineEXT;

		}
	}

}
